package com.book.bigwork.repository;

import com.book.bigwork.model.User;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;

public interface UserRepository extends JpaRepository<User, Long> {
    User findByUserName(String username);

    @EntityGraph(attributePaths = "roles")
    User findOneWithRolesByUserName(String userName);
}
